home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / PInterfaces / OCEMessaging.p < prev    next >
Encoding:
Text File  |  1995-04-18  |  32.0 KB  |  1,268 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        OCEMessaging.p
  3.  
  4.      Contains:    Apple Open Collaboration Environment Messaging Interfaces.
  5.  
  6.      Version:    Technology:    AOCE Toolbox 1.02
  7.                  Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT OCEMessaging;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __OCEMESSAGING__}
  30. {$SETC __OCEMESSAGING__ := 1}
  31.  
  32. {$I+}
  33. {$SETC OCEMessagingIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __APPLEEVENTS__}
  38. {$I AppleEvents.p}
  39. {$ENDC}
  40. {    Errors.p                                                    }
  41. {        ConditionalMacros.p                                        }
  42. {    Types.p                                                        }
  43. {    Memory.p                                                    }
  44. {        MixedMode.p                                                }
  45. {    OSUtils.p                                                    }
  46. {    Events.p                                                    }
  47. {        Quickdraw.p                                                }
  48. {            QuickdrawText.p                                        }
  49. {    EPPC.p                                                        }
  50. {        AppleTalk.p                                                }
  51. {        Files.p                                                    }
  52. {        PPCToolbox.p                                            }
  53. {        Processes.p                                                }
  54. {    Notification.p                                                }
  55.  
  56. {$IFC UNDEFINED __FILES__}
  57. {$I Files.p}
  58. {$ENDC}
  59.  
  60. {$IFC UNDEFINED __TYPES__}
  61. {$I Types.p}
  62. {$ENDC}
  63.  
  64. {$IFC UNDEFINED __DIGITALSIGNATURE__}
  65. {$I DigitalSignature.p}
  66. {$ENDC}
  67.  
  68. {$IFC UNDEFINED __OCE__}
  69. {$I OCE.p}
  70. {$ENDC}
  71. {    Aliases.p                                                    }
  72. {    Script.p                                                    }
  73. {        IntlResources.p                                            }
  74.  
  75. {$IFC UNDEFINED __OCEAUTHDIR__}
  76. {$I OCEAuthDir.p}
  77. {$ENDC}
  78.  
  79. {$PUSH}
  80. {$ALIGN MAC68K}
  81. {$LibExport+}
  82.  
  83. CONST
  84.     kIPMAnyPriority                = 0;                            { FOR FILTER ONLY }
  85.     kIPMNormalPriority            = 1;
  86.     kIPMLowPriority                = 2;
  87.     kIPMHighPriority            = 3;
  88.  
  89.     
  90. TYPE
  91.     IPMPriority = SignedByte;
  92.  
  93.  
  94. CONST
  95.     kIPMAtMark                    = 0;
  96.     kIPMFromStart                = 1;
  97.     kIPMFromLEOM                = 2;
  98.     kIPMFromMark                = 3;
  99.  
  100.     
  101. TYPE
  102.     IPMAccessMode = INTEGER;
  103.  
  104.  
  105. CONST
  106.     kIPMUpdateMsgBit            = 4;
  107.     kIPMNewMsgBit                = 5;
  108.     kIPMDeleteMsgBit            = 6;
  109.  
  110. { Values of IPMNotificationType }
  111.     kIPMUpdateMsgMask            = 1 * (2**(kIPMUpdateMsgBit));
  112.     kIPMNewMsgMask                = 1 * (2**(kIPMNewMsgBit));
  113.     kIPMDeleteMsgMask            = 1 * (2**(kIPMDeleteMsgBit));
  114.  
  115.     
  116. TYPE
  117.     IPMNotificationType = SignedByte;
  118.  
  119.  
  120. CONST
  121.     kIPMSenderRStringTag        = 0;
  122.     kIPMSenderRecordIDTag        = 1;
  123.  
  124.     
  125. TYPE
  126.     IPMSenderTag = INTEGER;
  127.  
  128.  
  129. CONST
  130.     kIPMFromDistListBit            = 0;
  131.     kIPMDummyRecBit                = 1;
  132.     kIPMFeedbackRecBit            = 2;                            { should be redirected to feedback queue }
  133.     kIPMReporterRecBit            = 3;                            { should be redirected to reporter original queue }
  134.     kIPMBCCRecBit                = 4;                            { this recipient is blind to all recipients of message }
  135.  
  136. { Values of OCERecipientOffsetFlags }
  137.     kIPMFromDistListMask        = 1 * (2**(kIPMFromDistListBit));
  138.     kIPMDummyRecMask            = 1 * (2**(kIPMDummyRecBit));
  139.     kIPMFeedbackRecMask            = 1 * (2**(kIPMFeedbackRecBit));
  140.     kIPMReporterRecMask            = 1 * (2**(kIPMReporterRecBit));
  141.     kIPMBCCRecMask                = 1 * (2**(kIPMBCCRecBit));
  142.  
  143.     
  144. TYPE
  145.     OCERecipientOffsetFlags = SignedByte;
  146.  
  147.     OCECreatorType = RECORD
  148.         msgCreator:                OSType;
  149.         msgType:                OSType;
  150.     END;
  151.  
  152.  
  153. CONST
  154.     kIPMTypeWildCard            = 'ipmw';
  155.     kIPMFamilyUnspecified        = 0;
  156.     kIPMFamilyWildCard            = $3F3F3F3F;                    { '??^ 
  157.  
  158.     * well known signature }
  159.     kIPMSignature                = 'ipms';                        { base type 
  160.  
  161.     * well known message types }
  162.     kIPMReportNotify            = 'rptn';                        { routing feedback
  163.  
  164.     * well known message block types }
  165.     kIPMEnclosedMsgType            = 'emsg';                        { enclosed (nested) message }
  166.     kIPMReportInfo                = 'rpti';                        { recipient information }
  167.     kIPMDigitalSignature        = 'dsig';
  168.  
  169. { Values of IPMMsgFormat }
  170.     kIPMOSFormatType            = 1;
  171.     kIPMStringFormatType        = 2;
  172.  
  173.     
  174. TYPE
  175.     IPMMsgFormat = INTEGER;
  176.  
  177.     IPMStringMsgType = Str32;
  178.  
  179.     TheType = RECORD
  180.         CASE INTEGER OF
  181.         0: (
  182.             msgOSType:                    OCECreatorType;
  183.            );
  184.         1: (
  185.             msgStrType:                    IPMStringMsgType;
  186.            );
  187.     END;
  188.  
  189.     IPMMsgType = RECORD
  190.         format:                    IPMMsgFormat;                            { IPMMsgFormat}
  191.         theType:                TheType;
  192.     END;
  193.  
  194. {
  195. Following are the known extension values for IPM addresses handled by Apple.
  196. We define the definition of the entn extension below.
  197. }
  198.  
  199. CONST
  200.     kOCEalanXtn                    = 'alan';
  201.     kOCEentnXtn                    = 'entn';                        { entn = entity name (aka DSSpec) }
  202.     kOCEaphnXtn                    = 'aphn';
  203.  
  204. {
  205. Following are the specific definitions for the extension for the standard
  206. OCEMail 'entn' addresses.  [Note, the actual extension is formatted as in
  207. IPMEntityNameExtension.]
  208. }
  209. { entn extension forms }
  210.     kOCEAddrXtn                    = 'addr';
  211.     kOCEQnamXtn                    = 'qnam';
  212.     kOCEAttrXtn                    = 'attr';                        { an attribute specification }
  213.     kOCESpAtXtn                    = 'spat';
  214.  
  215. {
  216. Following are the specific definitions for standard
  217. OCEMail 'aphn' extension value.  
  218.  
  219. All RStrings here are packed (e.g. truncated to length) and even padded (e.g.
  220. if length odd, then a pad byte (zero) should be introduced before the next field).
  221.  
  222. The extension value is in the packed form of the following structure:
  223.     RString        phoneNumber;
  224.     RString        modemType;
  225.     Str32        queueuName;
  226.  
  227. The body of phoneNumber compound RString is in the packed form of the following structure:
  228.     short         subType;
  229.     RString     countryCode;                // used when subType == kOCEUseHandyDial
  230.     RString        areaCode;                    // used when subType == kOCEUseHandyDial
  231.     RString        phone;                        // used when subType == kOCEUseHandyDial
  232.     RString        postFix;                    // used when subType == kOCEUseHandyDial
  233.     RString        nonHandyDialString;            // used when subType == kOCEDontUseHandyDial
  234. }
  235. { phoneNumber sub type constants }
  236.     kOCEUseHandyDial            = 1;
  237.     kOCEDontUseHandyDial        = 2;
  238.  
  239. { FORMAT OF A PACKED FORM RECIPIENT }
  240.  
  241. TYPE
  242.     ProtoOCEPackedRecipient = RECORD
  243.         dataLength:                INTEGER;
  244.     END;
  245.  
  246.  
  247. CONST
  248.     kOCEPackedRecipientMaxBytes    = 0+(4096 - sizeof(ProtoOCEPackedRecipient));
  249.  
  250.  
  251. TYPE
  252.     OCEPackedRecipient = RECORD
  253.         dataLength:                INTEGER;
  254.         data:                    ARRAY [0..kOCEPackedRecipientMaxBytes-1] OF SInt8; (* Byte *)
  255.     END;
  256.  
  257.     IPMEntnQueueExtension = RECORD
  258.         queueName:                Str32;
  259.     END;
  260.  
  261. { kOCEAttrXtn }
  262.     IPMEntnAttributeExtension = RECORD
  263.         attributeName:            AttributeType;
  264.     END;
  265.  
  266. { kOCESpAtXtn }
  267.     IPMEntnSpecificAttributeExtension = RECORD
  268.         attributeCreationID:    AttributeCreationID;
  269.         attributeName:            AttributeType;
  270.     END;
  271.  
  272. { All IPM entn extensions fit within the following }
  273.     IPMEntityNameExtension = RECORD
  274.         subExtensionType:        OSType;
  275.         CASE INTEGER OF
  276.         0: (
  277.             specificAttribute:            IPMEntnSpecificAttributeExtension;
  278.            );
  279.         1: (
  280.             attribute:                    IPMEntnAttributeExtension;
  281.            );
  282.         2: (
  283.             queue:                        IPMEntnQueueExtension;
  284.            );
  285.  
  286.     END;
  287.  
  288. { addresses with kIPMNBPXtn should specify this nbp type }
  289.     IPMMsgID = RECORD
  290.         id:                        ARRAY [0..3] OF LONGINT;
  291.     END;
  292.  
  293. { Values of IPMHeaderSelector }
  294.  
  295. CONST
  296.     kIPMTOC                        = 0;
  297.     kIPMSender                    = 1;
  298.     kIPMProcessHint                = 2;
  299.     kIPMMessageTitle            = 3;
  300.     kIPMMessageType                = 4;
  301.     kIPMFixedInfo                = 7;
  302.  
  303.     
  304. TYPE
  305.     IPMHeaderSelector = Byte;
  306.  
  307.     TheSender = RECORD
  308.         CASE INTEGER OF
  309.         0: (
  310.             rString:                    RString;
  311.            );
  312.         1: (
  313.             rid:                        PackedRecordID;
  314.            );
  315.     END;
  316.  
  317.     IPMSender = RECORD
  318.         sendTag:                IPMSenderTag;
  319.         theSender:                TheSender;
  320.     END;
  321.  
  322.     OCERecipient = DSSpec;
  323.  
  324. {****************************************************************************}
  325. { Definitions specific to OCEMessaging }
  326.     IPMContextRef = LONGINT;
  327.  
  328.     IPMQueueRef = LONGINT;
  329.  
  330.     IPMMsgRef = LONGINT;
  331.  
  332.     IPMSeqNum = LONGINT;
  333.  
  334.     IPMProcHint = Str32;
  335.  
  336.     IPMQueueName = Str32;
  337.  
  338.     IPMNoteProcPtr = ProcPtr;  { PROCEDURE IPMNote(queue: IPMQueueRef; seqNum: IPMSeqNum; notificationType: ByteParameter; userData: LONGINT); }
  339.     IPMNoteUPP = UniversalProcPtr;
  340.  
  341. CONST
  342.     uppIPMNoteProcInfo = $000037C0; { PROCEDURE (4 byte param, 4 byte param, 1 byte param, 4 byte param); }
  343.  
  344. FUNCTION NewIPMNoteProc(userRoutine: IPMNoteProcPtr): IPMNoteUPP;
  345.     {$IFC NOT GENERATINGCFM }
  346.     INLINE $2E9F;
  347.     {$ENDC}
  348.  
  349. PROCEDURE CallIPMNoteProc(queue: IPMQueueRef; seqNum: IPMSeqNum; notificationType: ByteParameter; userData: LONGINT; userRoutine: IPMNoteUPP);
  350.     {$IFC NOT GENERATINGCFM}
  351.     INLINE $205F, $4E90;
  352.     {$ENDC}
  353.  
  354. TYPE
  355.     IPMFixedHdrInfo = RECORD
  356.         version:                INTEGER;
  357.         authenticated:            BOOLEAN;
  358.         signatureEnclosed:        BOOLEAN;                                {  digital signature enclosed }
  359.         msgSize:                LONGINT;
  360.         notification:            IPMNotificationType;
  361.         priority:                IPMPriority;
  362.         blockCount:                INTEGER;
  363.         originalRcptCount:        INTEGER;                                {        original number of recipients }
  364.         refCon:                    LONGINT;                                {        Client defined data }
  365.         reserved:                INTEGER;
  366.         creationTime:            UTCTime;                                {        Time when it was created }
  367.         msgID:                    IPMMsgID;
  368.         family:                    OSType;                                    { family this msg belongs (e.g. mail) }
  369.     END;
  370.  
  371.  
  372. CONST
  373.     kIPMDeliveryNotificationBit    = 0;
  374.     kIPMNonDeliveryNotificationBit = 1;
  375.     kIPMEncloseOriginalBit        = 2;
  376.     kIPMSummaryReportBit        = 3;
  377. { modify enclose original to only on error }
  378.     kIPMOriginalOnlyOnErrorBit    = 4;
  379.  
  380.     kIPMNoNotificationMask        = $00;
  381.     kIPMDeliveryNotificationMask = 1 * (2**(kIPMDeliveryNotificationBit));
  382.     kIPMNonDeliveryNotificationMask = 1 * (2**(kIPMNonDeliveryNotificationBit));
  383.     kIPMDontEncloseOriginalMask    = $00;
  384.     kIPMEncloseOriginalMask        = 1 * (2**(kIPMEncloseOriginalBit));
  385.     kIPMImmediateReportMask        = $00;
  386.     kIPMSummaryReportMask        = 1 * (2**(kIPMSummaryReportBit));
  387.     kIPMOriginalOnlyOnErrorMask    = 1 * (2**(kIPMOriginalOnlyOnErrorBit));
  388.     kIPMEncloseOriginalOnErrorMask = 0+(kIPMOriginalOnlyOnErrorMask + kIPMEncloseOriginalMask);
  389.  
  390.     kIPMNoSuchRecipient            = $0001;
  391.     kIPMRecipientMalformed        = $0002;
  392.     kIPMRecipientAmbiguous        = $0003;
  393.     kIPMRecipientAccessDenied    = $0004;
  394.     kIPMGroupExpansionProblem    = $0005;
  395.     kIPMMsgUnreadable            = $0006;
  396.     kIPMMsgExpired                = $0007;
  397.     kIPMMsgNoTranslatableContent = $0008;
  398.     kIPMRecipientReqStdCont        = $0009;
  399.     kIPMRecipientReqSnapShot    = $000A;
  400.     kIPMNoTransferDiskFull        = $000B;
  401.     kIPMNoTransferMsgRejectedbyDest = $000C;
  402.     kIPMNoTransferMsgTooLarge    = $000D;
  403.  
  404. {***********************************************************************}
  405. {
  406. This is the structure that will be returned by enumerate and getmsginfo
  407. This definition is just to give you a template, the position of msgType
  408. is variable since this is a packed structure.  procHint and msgType are
  409. packed and even length padded.
  410.  
  411. * master message info }
  412.  
  413. TYPE
  414.     IPMMsgInfo = RECORD
  415.         sequenceNum:            IPMSeqNum;
  416.         userData:                LONGINT;
  417.         respIndex:                INTEGER;
  418.         padByte:                SInt8;
  419.         priority:                IPMPriority;
  420.         msgSize:                LONGINT;
  421.         originalRcptCount:        INTEGER;
  422.         reserved:                INTEGER;
  423.         creationTime:            UTCTime;
  424.         msgID:                    IPMMsgID;
  425.         family:                    OSType;                                    { family this msg belongs (e.g. mail) }
  426.         procHint:                IPMProcHint;
  427.         filler2:                SInt8;
  428.         msgType:                IPMMsgType;
  429.     END;
  430.  
  431.     IPMBlockType = OCECreatorType;
  432.  
  433.     IPMTOC = RECORD
  434.         blockType:                IPMBlockType;
  435.         blockOffset:            LONGINT;
  436.         blockSize:                LONGINT;
  437.         blockRefCon:            LONGINT;
  438.     END;
  439.  
  440. {
  441. The following structure is just to describe the layout of the SingleFilter.
  442. Each field should be packed and word aligned when passed to the IPM ToolBox.
  443. }
  444.     IPMSingleFilter = RECORD
  445.         priority:                IPMPriority;
  446.         padByte:                SInt8;
  447.         family:                    OSType;                                    { family this msg belongs (e.g. mail), '??^ for all }
  448.         script:                    ScriptCode;                                { Language Identifier }
  449.         hint:                    IPMProcHint;
  450.         filler2:                SInt8;
  451.         msgType:                IPMMsgType;
  452.     END;
  453.  
  454.     IPMFilter = RECORD
  455.         count:                    INTEGER;
  456.         sFilters:                ARRAY [0..0] OF IPMSingleFilter;
  457.     END;
  458.  
  459. {************************************************************************
  460. Following structures define the “start” of a recipient report block and the
  461. elements of the array respectively.
  462. }
  463.     IPMReportBlockHeader = RECORD
  464.         msgID:                    IPMMsgID;                                { message id of the original }
  465.         creationTime:            UTCTime;                                { creation time of the report }
  466.     END;
  467.  
  468.     OCERecipientReport = RECORD
  469.         rcptIndex:                INTEGER;                                { index of recipient in original message }
  470.         result:                    OSErr;                                    { result of sending letter to this recipient}
  471.     END;
  472.  
  473. {***********************************************************************}
  474.     IPMParamBlockPtr = ^IPMParamBlock;
  475.  
  476.     IPMIOCompletionProcPtr = ProcPtr;  { PROCEDURE IPMIOCompletion(paramBlock: IPMParamBlockPtr); }
  477.     IPMIOCompletionUPP = UniversalProcPtr;
  478.  
  479.     IPMOpenContextPB = RECORD
  480.         qLink:                    Ptr;
  481.         reservedH1:                LONGINT;
  482.         reservedH2:                LONGINT;
  483.         ioCompletion:            IPMIOCompletionUPP;
  484.         ioResult:                OSErr;
  485.         saveA5:                    LONGINT;
  486.         reqCode:                INTEGER;
  487.         contextRef:                IPMContextRef;                            { <--  Context reference to be used in further calls}
  488.     END;
  489.  
  490.     IPMCloseContextPB = IPMOpenContextPB;
  491.  
  492.     IPMCreateQueuePB = RECORD
  493.         qLink:                    Ptr;
  494.         reservedH1:                LONGINT;
  495.         reservedH2:                LONGINT;
  496.         ioCompletion:            IPMIOCompletionUPP;
  497.         ioResult:                OSErr;
  498.         saveA5:                    LONGINT;
  499.         reqCode:                INTEGER;
  500.         filler1:                LONGINT;
  501.         queue:                    ^OCERecipient;
  502.         identity:                AuthIdentity;                            { used only if queue is remote }
  503.         owner:                    ^PackedRecordID;                        { used only if queue is remote }
  504.     END;
  505.  
  506. { For createqueue and deletequeue only queue and identity are used }
  507.     IPMDeleteQueuePB = IPMCreateQueuePB;
  508.  
  509.     IPMOpenQueuePB = RECORD
  510.         qLink:                    Ptr;
  511.         reservedH1:                LONGINT;
  512.         reservedH2:                LONGINT;
  513.         ioCompletion:            IPMIOCompletionUPP;
  514.         ioResult:                OSErr;
  515.         saveA5:                    LONGINT;
  516.         reqCode:                INTEGER;
  517.         contextRef:                IPMContextRef;
  518.         queue:                    ^OCERecipient;
  519.         identity:                AuthIdentity;
  520.         filter:                    ^IPMFilter;
  521.         newQueueRef:            IPMQueueRef;
  522.         notificationProc:        IPMNoteUPP;
  523.         userData:                LONGINT;
  524.         noteType:                IPMNotificationType;
  525.         padByte:                SInt8; (* Byte *)
  526.         reserved:                LONGINT;
  527.         reserved2:                LONGINT;
  528.     END;
  529.  
  530.     IPMCloseQueuePB = RECORD
  531.         qLink:                    Ptr;
  532.         reservedH1:                LONGINT;
  533.         reservedH2:                LONGINT;
  534.         ioCompletion:            IPMIOCompletionUPP;
  535.         ioResult:                OSErr;
  536.         saveA5:                    LONGINT;
  537.         reqCode:                INTEGER;
  538.         queueRef:                IPMQueueRef;
  539.     END;
  540.  
  541.     IPMEnumerateQueuePB = RECORD
  542.         qLink:                    Ptr;
  543.         reservedH1:                LONGINT;
  544.         reservedH2:                LONGINT;
  545.         ioCompletion:            IPMIOCompletionUPP;
  546.         ioResult:                OSErr;
  547.         saveA5:                    LONGINT;
  548.         reqCode:                INTEGER;
  549.         queueRef:                IPMQueueRef;
  550.         startSeqNum:            IPMSeqNum;
  551.         getProcHint:            BOOLEAN;
  552.         getMsgType:                BOOLEAN;
  553.         filler:                    INTEGER;
  554.         filter:                    ^IPMFilter;
  555.         numToGet:                INTEGER;
  556.         numGotten:                INTEGER;
  557.         enumCount:                LONGINT;
  558.         enumBuffer:                Ptr;                                    { will be packed array of IPMMsgInfo }
  559.         actEnumCount:            LONGINT;
  560.     END;
  561.  
  562.     IPMChangeQueueFilterPB = IPMEnumerateQueuePB;
  563.  
  564.     IPMDeleteMsgRangePB = RECORD
  565.         qLink:                    Ptr;
  566.         reservedH1:                LONGINT;
  567.         reservedH2:                LONGINT;
  568.         ioCompletion:            IPMIOCompletionUPP;
  569.         ioResult:                OSErr;
  570.         saveA5:                    LONGINT;
  571.         reqCode:                INTEGER;
  572.         queueRef:                IPMQueueRef;
  573.         startSeqNum:            IPMSeqNum;
  574.         endSeqNum:                IPMSeqNum;
  575.         lastSeqNum:                IPMSeqNum;
  576.     END;
  577.  
  578.     IPMOpenMsgPB = RECORD
  579.         qLink:                    Ptr;
  580.         reservedH1:                LONGINT;
  581.         reservedH2:                LONGINT;
  582.         ioCompletion:            IPMIOCompletionUPP;
  583.         ioResult:                OSErr;
  584.         saveA5:                    LONGINT;
  585.         reqCode:                INTEGER;
  586.         queueRef:                IPMQueueRef;
  587.         sequenceNum:            IPMSeqNum;
  588.         newMsgRef:                IPMMsgRef;
  589.         actualSeqNum:            IPMSeqNum;
  590.         exactMatch:                BOOLEAN;
  591.         padByte:                SInt8; (* Byte *)
  592.         reserved:                LONGINT;
  593.     END;
  594.  
  595.     IPMOpenHFSMsgPB = RECORD
  596.         qLink:                    Ptr;
  597.         reservedH1:                LONGINT;
  598.         reservedH2:                LONGINT;
  599.         ioCompletion:            IPMIOCompletionUPP;
  600.         ioResult:                OSErr;
  601.         saveA5:                    LONGINT;
  602.         reqCode:                INTEGER;
  603.         hfsPath:                ^FSSpec;
  604.         filler:                    LONGINT;
  605.         newMsgRef:                IPMMsgRef;
  606.         filler2:                LONGINT;
  607.         filler3:                SInt8; (* Byte *)
  608.         filler4:                BOOLEAN;
  609.         reserved:                LONGINT;
  610.     END;
  611.  
  612.     IPMOpenBlockAsMsgPB = RECORD
  613.         qLink:                    Ptr;
  614.         reservedH1:                LONGINT;
  615.         reservedH2:                LONGINT;
  616.         ioCompletion:            IPMIOCompletionUPP;
  617.         ioResult:                OSErr;
  618.         saveA5:                    LONGINT;
  619.         reqCode:                INTEGER;
  620.         msgRef:                    IPMMsgRef;
  621.         filler:                    LONGINT;
  622.         newMsgRef:                IPMMsgRef;
  623.         filler2:                ARRAY [0..6] OF INTEGER;
  624.         blockIndex:                INTEGER;
  625.     END;
  626.  
  627.     IPMCloseMsgPB = RECORD
  628.         qLink:                    Ptr;
  629.         reservedH1:                LONGINT;
  630.         reservedH2:                LONGINT;
  631.         ioCompletion:            IPMIOCompletionUPP;
  632.         ioResult:                OSErr;
  633.         saveA5:                    LONGINT;
  634.         reqCode:                INTEGER;
  635.         msgRef:                    IPMMsgRef;
  636.         deleteMsg:                BOOLEAN;
  637.         filler1:                BOOLEAN;
  638.     END;
  639.  
  640.     IPMGetMsgInfoPB = RECORD
  641.         qLink:                    Ptr;
  642.         reservedH1:                LONGINT;
  643.         reservedH2:                LONGINT;
  644.         ioCompletion:            IPMIOCompletionUPP;
  645.         ioResult:                OSErr;
  646.         saveA5:                    LONGINT;
  647.         reqCode:                INTEGER;
  648.         msgRef:                    IPMMsgRef;
  649.         info:                    ^IPMMsgInfo;
  650.     END;
  651.  
  652.     IPMReadHeaderPB = RECORD
  653.         qLink:                    Ptr;
  654.         reservedH1:                LONGINT;
  655.         reservedH2:                LONGINT;
  656.         ioCompletion:            IPMIOCompletionUPP;
  657.         ioResult:                OSErr;
  658.         saveA5:                    LONGINT;
  659.         reqCode:                INTEGER;
  660.         msgRef:                    IPMMsgRef;
  661.         fieldSelector:            INTEGER;
  662.         offset:                    LONGINT;
  663.         count:                    LONGINT;
  664.         buffer:                    Ptr;
  665.         actualCount:            LONGINT;
  666.         filler:                    INTEGER;
  667.         remaining:                LONGINT;
  668.     END;
  669.  
  670.     IPMReadRecipientPB = RECORD
  671.         qLink:                    Ptr;
  672.         reservedH1:                LONGINT;
  673.         reservedH2:                LONGINT;
  674.         ioCompletion:            IPMIOCompletionUPP;
  675.         ioResult:                OSErr;
  676.         saveA5:                    LONGINT;
  677.         reqCode:                INTEGER;
  678.         msgRef:                    IPMMsgRef;
  679.         rcptIndex:                INTEGER;
  680.         offset:                    LONGINT;
  681.         count:                    LONGINT;
  682.         buffer:                    Ptr;
  683.         actualCount:            LONGINT;
  684.         reserved:                INTEGER;                                { must be zero }
  685.         remaining:                LONGINT;
  686.         originalIndex:            INTEGER;
  687.         recipientOffsetFlags:    OCERecipientOffsetFlags;
  688.         filler1:                BOOLEAN;
  689.     END;
  690.  
  691. {
  692. replyQueue works like recipient. [can no longer read it via ReadHeader]
  693. OriginalIndex is meaningless, rcptFlags are used seperately and there are
  694. currently none defined.
  695. }
  696.     IPMReadReplyQueuePB = IPMReadRecipientPB;
  697.  
  698.     IPMGetBlkIndexPB = RECORD
  699.         qLink:                    Ptr;
  700.         reservedH1:                LONGINT;
  701.         reservedH2:                LONGINT;
  702.         ioCompletion:            IPMIOCompletionUPP;
  703.         ioResult:                OSErr;
  704.         saveA5:                    LONGINT;
  705.         reqCode:                INTEGER;
  706.         msgRef:                    IPMMsgRef;
  707.         blockType:                IPMBlockType;
  708.         index:                    INTEGER;
  709.         startingFrom:            INTEGER;
  710.         actualBlockType:        IPMBlockType;
  711.         actualBlockIndex:        INTEGER;
  712.     END;
  713.  
  714.     IPMReadMsgPB = RECORD
  715.         qLink:                    Ptr;
  716.         reservedH1:                LONGINT;
  717.         reservedH2:                LONGINT;
  718.         ioCompletion:            IPMIOCompletionUPP;
  719.         ioResult:                OSErr;
  720.         saveA5:                    LONGINT;
  721.         reqCode:                INTEGER;
  722.         msgRef:                    IPMMsgRef;
  723.         mode:                    IPMAccessMode;
  724.         offset:                    LONGINT;
  725.         count:                    LONGINT;
  726.         buffer:                    Ptr;
  727.         actualCount:            LONGINT;
  728.         blockIndex:                INTEGER;
  729.         remaining:                LONGINT;
  730.     END;
  731.  
  732.     IPMVerifySignaturePB = RECORD
  733.         qLink:                    Ptr;
  734.         reservedH1:                LONGINT;
  735.         reservedH2:                LONGINT;
  736.         ioCompletion:            IPMIOCompletionUPP;
  737.         ioResult:                OSErr;
  738.         saveA5:                    LONGINT;
  739.         reqCode:                INTEGER;
  740.         msgRef:                    IPMMsgRef;
  741.         signatureContext:        SIGContextPtr;
  742.     END;
  743.  
  744.     IPMNewMsgPB = RECORD
  745.         qLink:                    Ptr;
  746.         reservedH1:                LONGINT;
  747.         reservedH2:                LONGINT;
  748.         ioCompletion:            IPMIOCompletionUPP;
  749.         ioResult:                OSErr;
  750.         saveA5:                    LONGINT;
  751.         reqCode:                INTEGER;
  752.         filler:                    LONGINT;
  753.         recipient:                ^OCERecipient;
  754.         replyQueue:                ^OCERecipient;
  755.         procHint:                StringPtr;
  756.         filler2:                INTEGER;
  757.         msgType:                ^IPMMsgType;
  758.         refCon:                    LONGINT;
  759.         newMsgRef:                IPMMsgRef;
  760.         filler3:                INTEGER;
  761.         filler4:                LONGINT;
  762.         identity:                AuthIdentity;
  763.         sender:                    ^IPMSender;
  764.         internalUse:            LONGINT;
  765.         internalUse2:            LONGINT;
  766.     END;
  767.  
  768.     IPMNewHFSMsgPB = RECORD
  769.         qLink:                    Ptr;
  770.         reservedH1:                LONGINT;
  771.         reservedH2:                LONGINT;
  772.         ioCompletion:            IPMIOCompletionUPP;
  773.         ioResult:                OSErr;
  774.         saveA5:                    LONGINT;
  775.         reqCode:                INTEGER;
  776.         hfsPath:                ^FSSpec;
  777.         recipient:                ^OCERecipient;
  778.         replyQueue:                ^OCERecipient;
  779.         procHint:                StringPtr;
  780.         filler2:                INTEGER;
  781.         msgType:                ^IPMMsgType;
  782.         refCon:                    LONGINT;
  783.         newMsgRef:                IPMMsgRef;
  784.         filler3:                INTEGER;
  785.         filler4:                LONGINT;
  786.         identity:                AuthIdentity;
  787.         sender:                    ^IPMSender;
  788.         internalUse:            LONGINT;
  789.         internalUse2:            LONGINT;
  790.     END;
  791.  
  792.     IPMNestMsgPB = RECORD
  793.         qLink:                    Ptr;
  794.         reservedH1:                LONGINT;
  795.         reservedH2:                LONGINT;
  796.         ioCompletion:            IPMIOCompletionUPP;
  797.         ioResult:                OSErr;
  798.         saveA5:                    LONGINT;
  799.         reqCode:                INTEGER;
  800.         msgRef:                    IPMMsgRef;
  801.         filler:                    ARRAY [0..8] OF INTEGER;
  802.         refCon:                    LONGINT;
  803.         msgToNest:                IPMMsgRef;
  804.         filler2:                INTEGER;
  805.         startingOffset:            LONGINT;
  806.     END;
  807.  
  808.     IPMNewNestedMsgBlockPB = RECORD
  809.         qLink:                    Ptr;
  810.         reservedH1:                LONGINT;
  811.         reservedH2:                LONGINT;
  812.         ioCompletion:            IPMIOCompletionUPP;
  813.         ioResult:                OSErr;
  814.         saveA5:                    LONGINT;
  815.         reqCode:                INTEGER;
  816.         msgRef:                    IPMMsgRef;
  817.         recipient:                ^OCERecipient;
  818.         replyQueue:                ^OCERecipient;
  819.         procHint:                StringPtr;
  820.         filler1:                INTEGER;
  821.         msgType:                ^IPMMsgType;
  822.         refCon:                    LONGINT;
  823.         newMsgRef:                IPMMsgRef;
  824.         filler2:                INTEGER;
  825.         startingOffset:            LONGINT;
  826.         identity:                AuthIdentity;
  827.         sender:                    ^IPMSender;
  828.         internalUse:            LONGINT;
  829.         internalUse2:            LONGINT;
  830.     END;
  831.  
  832.     IPMEndMsgPB = RECORD
  833.         qLink:                    Ptr;
  834.         reservedH1:                LONGINT;
  835.         reservedH2:                LONGINT;
  836.         ioCompletion:            IPMIOCompletionUPP;
  837.         ioResult:                OSErr;
  838.         saveA5:                    LONGINT;
  839.         reqCode:                INTEGER;
  840.         msgRef:                    IPMMsgRef;
  841.         msgID:                    IPMMsgID;
  842.         msgTitle:                ^RString;
  843.         deliveryNotification:    IPMNotificationType;
  844.         priority:                IPMPriority;
  845.         cancel:                    BOOLEAN;
  846.         padByte:                SInt8; (* Byte *)
  847.         reserved:                LONGINT;
  848.         signature:                SIGSignaturePtr;
  849.         signatureSize:            Size;
  850.         signatureContext:        SIGContextPtr;
  851.         { family this msg belongs (e.g. mail) use kIPMFamilyUnspecified by default }
  852.         family:                    OSType;
  853.     END;
  854.  
  855.     IPMAddRecipientPB = RECORD
  856.         qLink:                    Ptr;
  857.         reservedH1:                LONGINT;
  858.         reservedH2:                LONGINT;
  859.         ioCompletion:            IPMIOCompletionUPP;
  860.         ioResult:                OSErr;
  861.         saveA5:                    LONGINT;
  862.         reqCode:                INTEGER;
  863.         msgRef:                    IPMMsgRef;
  864.         recipient:                ^OCERecipient;
  865.         reserved:                LONGINT;
  866.     END;
  867.  
  868.     IPMAddReplyQueuePB = RECORD
  869.         qLink:                    Ptr;
  870.         reservedH1:                LONGINT;
  871.         reservedH2:                LONGINT;
  872.         ioCompletion:            IPMIOCompletionUPP;
  873.         ioResult:                OSErr;
  874.         saveA5:                    LONGINT;
  875.         reqCode:                INTEGER;
  876.         msgRef:                    IPMMsgRef;
  877.         filler:                    LONGINT;
  878.         replyQueue:                ^OCERecipient;
  879.     END;
  880.  
  881.     IPMNewBlockPB = RECORD
  882.         qLink:                    Ptr;
  883.         reservedH1:                LONGINT;
  884.         reservedH2:                LONGINT;
  885.         ioCompletion:            IPMIOCompletionUPP;
  886.         ioResult:                OSErr;
  887.         saveA5:                    LONGINT;
  888.         reqCode:                INTEGER;
  889.         msgRef:                    IPMMsgRef;
  890.         blockType:                IPMBlockType;
  891.         filler:                    ARRAY [0..4] OF INTEGER;
  892.         refCon:                    LONGINT;
  893.         filler2:                ARRAY [0..2] OF INTEGER;
  894.         startingOffset:            LONGINT;
  895.     END;
  896.  
  897.     IPMWriteMsgPB = RECORD
  898.         qLink:                    Ptr;
  899.         reservedH1:                LONGINT;
  900.         reservedH2:                LONGINT;
  901.         ioCompletion:            IPMIOCompletionUPP;
  902.         ioResult:                OSErr;
  903.         saveA5:                    LONGINT;
  904.         reqCode:                INTEGER;
  905.         msgRef:                    IPMMsgRef;
  906.         mode:                    IPMAccessMode;
  907.         offset:                    LONGINT;
  908.         count:                    LONGINT;
  909.         buffer:                    Ptr;
  910.         actualCount:            LONGINT;
  911.         currentBlock:            BOOLEAN;
  912.         filler1:                BOOLEAN;
  913.     END;
  914.  
  915.     IPMParamBlock = RECORD
  916.         CASE INTEGER OF
  917.         0: (
  918.             qLink:                        Ptr;
  919.             reservedH1:                    LONGINT;
  920.             reservedH2:                    LONGINT;
  921.             ioCompletion:                IPMIOCompletionUPP;
  922.             ioResult:                    OSErr;
  923.             saveA5:                        LONGINT;
  924.             reqCode:                    INTEGER;
  925.            );
  926.         1: (
  927.             openContextPB:                IPMOpenContextPB;
  928.            );
  929.         2: (
  930.             closeContextPB:                IPMCloseContextPB;
  931.            );
  932.         3: (
  933.             createQueuePB:                IPMCreateQueuePB;
  934.            );
  935.         4: (
  936.             deleteQueuePB:                IPMDeleteQueuePB;
  937.            );
  938.         5: (
  939.             openQueuePB:                IPMOpenQueuePB;
  940.            );
  941.         6: (
  942.             closeQueuePB:                IPMCloseQueuePB;
  943.            );
  944.         7: (
  945.             enumerateQueuePB:            IPMEnumerateQueuePB;
  946.            );
  947.         8: (
  948.             changeQueueFilterPB:        IPMChangeQueueFilterPB;
  949.            );
  950.         9: (
  951.             deleteMsgRangePB:            IPMDeleteMsgRangePB;
  952.            );
  953.         10: (
  954.             openMsgPB:                    IPMOpenMsgPB;
  955.            );
  956.         11: (
  957.             openHFSMsgPB:                IPMOpenHFSMsgPB;
  958.            );
  959.         12: (
  960.             openBlockAsMsgPB:            IPMOpenBlockAsMsgPB;
  961.            );
  962.         13: (
  963.             closeMsgPB:                    IPMCloseMsgPB;
  964.            );
  965.         14: (
  966.             getMsgInfoPB:                IPMGetMsgInfoPB;
  967.            );
  968.         15: (
  969.             readHeaderPB:                IPMReadHeaderPB;
  970.            );
  971.         16: (
  972.             readRecipientPB:            IPMReadRecipientPB;
  973.            );
  974.         17: (
  975.             readReplyQueuePB:            IPMReadReplyQueuePB;
  976.            );
  977.         18: (
  978.             getBlkIndexPB:                IPMGetBlkIndexPB;
  979.            );
  980.         19: (
  981.             readMsgPB:                    IPMReadMsgPB;
  982.            );
  983.         20: (
  984.             verifySignaturePB:            IPMVerifySignaturePB;
  985.            );
  986.         21: (
  987.             newMsgPB:                    IPMNewMsgPB;
  988.            );
  989.         22: (
  990.             newHFSMsgPB:                IPMNewHFSMsgPB;
  991.            );
  992.         23: (
  993.             nestMsgPB:                    IPMNestMsgPB;
  994.            );
  995.         24: (
  996.             newNestedMsgBlockPB:        IPMNewNestedMsgBlockPB;
  997.            );
  998.         25: (
  999.             endMsgPB:                    IPMEndMsgPB;
  1000.            );
  1001.         26: (
  1002.             addRecipientPB:                IPMAddRecipientPB;
  1003.            );
  1004.         27: (
  1005.             addReplyQueuePB:            IPMAddReplyQueuePB;
  1006.            );
  1007.         28: (
  1008.             newBlockPB:                    IPMNewBlockPB;
  1009.            );
  1010.         29: (
  1011.             writeMsgPB:                    IPMWriteMsgPB;
  1012.            );
  1013.     END;
  1014.  
  1015. {    Request codes }
  1016.  
  1017. CONST
  1018.     kIPMOpenContext                = $400;
  1019.     kIPMCloseContext            = $401;
  1020.     kIPMNewMsg                    = $402;
  1021.     kIPMAddRecipient            = $403;
  1022.     kIPMNewBlock                = $404;
  1023.     kIPMNewNestedMsgBlock        = $405;
  1024.     kIPMNestMsg                    = $406;
  1025.     kIPMWriteMsg                = $407;
  1026.     kIPMEndMsg                    = $408;
  1027.     kIPMOpenQueue                = $409;
  1028.     kIPMCloseQueue                = $40A;
  1029.     kIPMOpenMsg                    = $40B;
  1030.     kIPMCloseMsg                = $40C;
  1031.     kIPMReadMsg                    = $40D;
  1032.     kIPMReadHeader                = $40E;
  1033.     kIPMOpenBlockAsMsg            = $40F;
  1034.     kIPMReadRecipient            = $410;
  1035.     kIPMCreateQueue                = $411;
  1036.     kIPMDeleteQueue                = $412;
  1037.     kIPMEnumerateQueue            = $413;
  1038.     kIPMChangeQueueFilter        = $414;
  1039.     kIPMDeleteMsgRange            = $415;
  1040.     kIPMOpenHFSMsg                = $417;
  1041.     kIPMGetBlkIndex                = $418;
  1042.     kIPMGetMsgInfo                = $419;
  1043.     kIPMAddReplyQueue            = $41D;
  1044.     kIPMNewHFSMsg                = $41E;
  1045.     kIPMReadReplyQueue            = $421;
  1046.     kIPMVerifySignature            = $422;
  1047.  
  1048.     uppIPMIOCompletionProcInfo = $000000C0; { PROCEDURE (4 byte param); }
  1049.  
  1050. PROCEDURE CallIPMIOCompletionProc(paramBlock: IPMParamBlockPtr; userRoutine: IPMIOCompletionUPP);
  1051.     {$IFC NOT GENERATINGCFM}
  1052.     INLINE $205F, $4E90;
  1053.     {$ENDC}
  1054.  
  1055. FUNCTION NewIPMIOCompletionProc(userRoutine: IPMIOCompletionProcPtr): IPMIOCompletionUPP;
  1056.     {$IFC NOT GENERATINGCFM }
  1057.     INLINE $2E9F;
  1058.     {$ENDC}
  1059.  
  1060. FUNCTION IPMOpenContext(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1061.     {$IFC NOT GENERATINGCFM}
  1062.     INLINE $3F3C, $400, $AA5E;
  1063.     {$ENDC}
  1064. FUNCTION IPMCloseContext(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1065.     {$IFC NOT GENERATINGCFM}
  1066.     INLINE $3F3C, $401, $AA5E;
  1067.     {$ENDC}
  1068. FUNCTION IPMNewMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1069.     {$IFC NOT GENERATINGCFM}
  1070.     INLINE $3F3C, $402, $AA5E;
  1071.     {$ENDC}
  1072. FUNCTION IPMNewBlock(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1073.     {$IFC NOT GENERATINGCFM}
  1074.     INLINE $3F3C, $404, $AA5E;
  1075.     {$ENDC}
  1076. FUNCTION IPMNewNestedMsgBlock(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1077.     {$IFC NOT GENERATINGCFM}
  1078.     INLINE $3F3C, $405, $AA5E;
  1079.     {$ENDC}
  1080. FUNCTION IPMNestMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1081.     {$IFC NOT GENERATINGCFM}
  1082.     INLINE $3F3C, $406, $AA5E;
  1083.     {$ENDC}
  1084. FUNCTION IPMWriteMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1085.     {$IFC NOT GENERATINGCFM}
  1086.     INLINE $3F3C, $407, $AA5E;
  1087.     {$ENDC}
  1088. FUNCTION IPMEndMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1089.     {$IFC NOT GENERATINGCFM}
  1090.     INLINE $3F3C, $408, $AA5E;
  1091.     {$ENDC}
  1092. FUNCTION IPMOpenQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1093.     {$IFC NOT GENERATINGCFM}
  1094.     INLINE $3F3C, $409, $AA5E;
  1095.     {$ENDC}
  1096. FUNCTION IPMCloseQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1097.     {$IFC NOT GENERATINGCFM}
  1098.     INLINE $3F3C, $40A, $AA5E;
  1099.     {$ENDC}
  1100. { Always synchronous }
  1101. FUNCTION IPMVerifySignature(paramBlock: IPMParamBlockPtr): OSErr;
  1102.     {$IFC NOT GENERATINGCFM}
  1103.     INLINE $7000, $1f00, $3F3C, $422, $AA5E;
  1104.     {$ENDC}
  1105. FUNCTION IPMOpenMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1106.     {$IFC NOT GENERATINGCFM}
  1107.     INLINE $3F3C, $40B, $AA5E;
  1108.     {$ENDC}
  1109. FUNCTION IPMCloseMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1110.     {$IFC NOT GENERATINGCFM}
  1111.     INLINE $3F3C, $40C, $AA5E;
  1112.     {$ENDC}
  1113. FUNCTION IPMReadMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1114.     {$IFC NOT GENERATINGCFM}
  1115.     INLINE $3F3C, $40D, $AA5E;
  1116.     {$ENDC}
  1117. FUNCTION IPMReadHeader(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1118.     {$IFC NOT GENERATINGCFM}
  1119.     INLINE $3F3C, $40E, $AA5E;
  1120.     {$ENDC}
  1121. FUNCTION IPMOpenBlockAsMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1122.     {$IFC NOT GENERATINGCFM}
  1123.     INLINE $3F3C, $40F, $AA5E;
  1124.     {$ENDC}
  1125. FUNCTION IPMNewHFSMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1126.     {$IFC NOT GENERATINGCFM}
  1127.     INLINE $3F3C, $41E, $AA5E;
  1128.     {$ENDC}
  1129. FUNCTION IPMReadRecipient(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1130.     {$IFC NOT GENERATINGCFM}
  1131.     INLINE $3F3C, $410, $AA5E;
  1132.     {$ENDC}
  1133. FUNCTION IPMReadReplyQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1134.     {$IFC NOT GENERATINGCFM}
  1135.     INLINE $3F3C, $421, $AA5E;
  1136.     {$ENDC}
  1137. FUNCTION IPMCreateQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1138.     {$IFC NOT GENERATINGCFM}
  1139.     INLINE $3F3C, $411, $AA5E;
  1140.     {$ENDC}
  1141. FUNCTION IPMDeleteQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1142.     {$IFC NOT GENERATINGCFM}
  1143.     INLINE $3F3C, $412, $AA5E;
  1144.     {$ENDC}
  1145. FUNCTION IPMEnumerateQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1146.     {$IFC NOT GENERATINGCFM}
  1147.     INLINE $3F3C, $413, $AA5E;
  1148.     {$ENDC}
  1149. FUNCTION IPMChangeQueueFilter(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1150.     {$IFC NOT GENERATINGCFM}
  1151.     INLINE $3F3C, $414, $AA5E;
  1152.     {$ENDC}
  1153. FUNCTION IPMDeleteMsgRange(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1154.     {$IFC NOT GENERATINGCFM}
  1155.     INLINE $3F3C, $415, $AA5E;
  1156.     {$ENDC}
  1157. FUNCTION IPMAddRecipient(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1158.     {$IFC NOT GENERATINGCFM}
  1159.     INLINE $3F3C, $403, $AA5E;
  1160.     {$ENDC}
  1161. FUNCTION IPMAddReplyQueue(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1162.     {$IFC NOT GENERATINGCFM}
  1163.     INLINE $3F3C, $41D, $AA5E;
  1164.     {$ENDC}
  1165. FUNCTION IPMOpenHFSMsg(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1166.     {$IFC NOT GENERATINGCFM}
  1167.     INLINE $3F3C, $417, $AA5E;
  1168.     {$ENDC}
  1169. FUNCTION IPMGetBlkIndex(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1170.     {$IFC NOT GENERATINGCFM}
  1171.     INLINE $3F3C, $418, $AA5E;
  1172.     {$ENDC}
  1173. FUNCTION IPMGetMsgInfo(paramBlock: IPMParamBlockPtr; async: BOOLEAN): OSErr;
  1174.     {$IFC NOT GENERATINGCFM}
  1175.     INLINE $3F3C, $419, $AA5E;
  1176.     {$ENDC}
  1177. {**************************************************************************************}
  1178. { EXTERNAL ROUTINES }
  1179.  
  1180. CONST
  1181.     kOCESizePackedRecipient        = 830;
  1182.     kOCEPackRecipient            = 831;
  1183.     kOCEUnpackRecipient            = 832;
  1184.     kOCEStreamRecipient            = 833;
  1185.     kOCEGetRecipientType        = 834;
  1186.     kOCESetRecipientType        = 835;
  1187.  
  1188.  
  1189. FUNCTION OCESizePackedRecipient({CONST}VAR rcpt: OCERecipient): INTEGER;
  1190.     {$IFC NOT GENERATINGCFM}
  1191.     INLINE $303C, 830, $AA5C;
  1192.     {$ENDC}
  1193. {
  1194. Take an OCERecipient (scatter) and (gather) stream into the specified
  1195. buffer.  It is assumed that there is sufficient space in the buffer (that is
  1196. OCESizePackedRecipient).  Safe to pass dereferenced handle(s).
  1197. }
  1198. FUNCTION OCEPackRecipient({CONST}VAR rcpt: OCERecipient; buffer: UNIV Ptr): INTEGER;
  1199.     {$IFC NOT GENERATINGCFM}
  1200.     INLINE $303C, 831, $AA5C;
  1201.     {$ENDC}
  1202. {
  1203. Take a packed OCERecipient and cast a the OCERecipient frame over it. Returns
  1204. amBadDestId if it doesn't look like an OCERecipient. Safe to pass dereferenced
  1205. handle(s).
  1206. }
  1207. FUNCTION OCEUnpackRecipient(buffer: UNIV Ptr; VAR rcpt: OCERecipient; VAR entitySpecifier: RecordID): OSErr;
  1208.     {$IFC NOT GENERATINGCFM}
  1209.     INLINE $303C, 832, $AA5C;
  1210.     {$ENDC}
  1211. {
  1212. Take an OCERecipient (scatter) and (gather) stream using the specified
  1213. function.  Safe to pass dereferenced handle(s).  If streamer function returns
  1214. OCEError OCEStreamRecipient stops execution and passes the error back to the caller
  1215. }
  1216. TYPE
  1217.     OCERecipientStreamerProcPtr = ProcPtr;  { FUNCTION OCERecipientStreamer(buffer: UNIV Ptr; count: LONGINT; eof: BOOLEAN; userData: LONGINT): OSErr; }
  1218.     OCERecipientStreamerUPP = UniversalProcPtr;
  1219.  
  1220. CONST
  1221.     uppOCERecipientStreamerProcInfo = $000037E0; { FUNCTION (4 byte param, 4 byte param, 1 byte param, 4 byte param): 2 byte result; }
  1222.  
  1223. FUNCTION NewOCERecipientStreamerProc(userRoutine: OCERecipientStreamerProcPtr): OCERecipientStreamerUPP;
  1224.     {$IFC NOT GENERATINGCFM }
  1225.     INLINE $2E9F;
  1226.     {$ENDC}
  1227.  
  1228. FUNCTION CallOCERecipientStreamerProc(buffer: UNIV Ptr; count: LONGINT; eof: BOOLEAN; userData: LONGINT; userRoutine: OCERecipientStreamerUPP): OSErr;
  1229.     {$IFC NOT GENERATINGCFM}
  1230.     INLINE $205F, $4E90;
  1231.     {$ENDC}
  1232.     
  1233. TYPE
  1234.     OCERecipientStreamer = OCERecipientStreamerUPP;
  1235.  
  1236.  
  1237. FUNCTION OCEStreamRecipient({CONST}VAR rcpt: OCERecipient; stream: OCERecipientStreamer; userData: LONGINT; VAR actualCount: LONGINT): OSErr;
  1238.     {$IFC NOT GENERATINGCFM}
  1239.     INLINE $303C, 833, $AA5C;
  1240.     {$ENDC}
  1241. { Get the OCERecipient's extensionType. Safe to pass dereferenced handle(s).}
  1242. FUNCTION OCEGetRecipientType({CONST}VAR cid: CreationID): OSType;
  1243.     {$IFC NOT GENERATINGCFM}
  1244.     INLINE $303C, 834, $AA5C;
  1245.     {$ENDC}
  1246. {
  1247. Set the OCERecipient's extensionType in the specified cid.  (Note: we do NOT
  1248. check for a nil pointer).  If the extensionType is 'entn', the cid is assumed
  1249. to be "valid" and is not touched.  Note: to properly handle non 'entn''s this
  1250. routine must and will zero the high long (source) of the cid! Safe to pass
  1251. dereferenced handle(s).
  1252. }
  1253. PROCEDURE OCESetRecipientType(extensionType: OSType; VAR cid: CreationID);
  1254.     {$IFC NOT GENERATINGCFM}
  1255.     INLINE $303C, 835, $AA5C;
  1256.     {$ENDC}
  1257.  
  1258. {$ALIGN RESET}
  1259. {$POP}
  1260.  
  1261. {$SETC UsingIncludes := OCEMessagingIncludes}
  1262.  
  1263. {$ENDC} {__OCEMESSAGING__}
  1264.  
  1265. {$IFC NOT UsingIncludes}
  1266.  END.
  1267. {$ENDC}
  1268.